package Pojo;

import java.util.Date;
import java.util.Objects;

//订单详情实体类
public class OrderDetails {
    private Integer order_details_id;//订单详情id（主键）
    private Integer order_id;//订单id（订单表主键）
    private Integer room_id;//房间id（房间表主键）
    private Date startdate;//入住起始日期
    private Date enddate;//入住结束日期
    private Integer price_sum;//订单总价
    private Integer room_number_id;//

    //下面的属性用于mybatis表关系查询，一对一，一对多，多对多
    //ps:根据代码需求可以自行添加
    private Order order;//订单实体类对象
    private Room room;//房间实体类对象
    private RoomNumber roomNumber;

    public OrderDetails() {
    }

    @Override
    public String
    toString() {
        return "OrderDetails{" +
                "order_details_id=" + order_details_id +
                ", order_id=" + order_id +
                ", room_id=" + room_id +
                ", startdate=" + startdate +
                ", enddate=" + enddate +
                ", price_sum=" + price_sum +
                ", room_number_id=" + room_number_id +
                ", order=" + order +
                ", room=" + room +
                ", roomNumber=" + roomNumber +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        OrderDetails that = (OrderDetails) o;
        return Objects.equals(order_details_id, that.order_details_id) &&
                Objects.equals(order_id, that.order_id) &&
                Objects.equals(room_id, that.room_id) &&
                Objects.equals(startdate, that.startdate) &&
                Objects.equals(enddate, that.enddate) &&
                Objects.equals(price_sum, that.price_sum) &&
                Objects.equals(room_number_id, that.room_number_id) &&
                Objects.equals(order, that.order) &&
                Objects.equals(room, that.room) &&
                Objects.equals(roomNumber, that.roomNumber);
    }

    @Override
    public int hashCode() {
        return Objects.hash(order_details_id, order_id, room_id, startdate, enddate, price_sum, room_number_id, order, room, roomNumber);
    }

    public Integer getOrder_details_id() {
        return order_details_id;
    }

    public void setOrder_details_id(Integer order_details_id) {
        this.order_details_id = order_details_id;
    }

    public Integer getOrder_id() {
        return order_id;
    }

    public void setOrder_id(Integer order_id) {
        this.order_id = order_id;
    }

    public Integer getRoom_id() {
        return room_id;
    }

    public void setRoom_id(Integer room_id) {
        this.room_id = room_id;
    }

    public Date getStartdate() {
        return startdate;
    }

    public void setStartdate(Date startdate) {
        this.startdate = startdate;
    }

    public Date getEnddate() {
        return enddate;
    }

    public void setEnddate(Date enddate) {
        this.enddate = enddate;
    }

    public Integer getPrice_sum() {
        return price_sum;
    }

    public void setPrice_sum(Integer price_sum) {
        this.price_sum = price_sum;
    }

    public Integer getRoom_number_id() {
        return room_number_id;
    }

    public void setRoom_number_id(Integer room_number_id) {
        this.room_number_id = room_number_id;
    }

    public Order getOrder() {
        return order;
    }

    public void setOrder(Order order) {
        this.order = order;
    }

    public Room getRoom() {
        return room;
    }

    public void setRoom(Room room) {
        this.room = room;
    }

    public RoomNumber getRoomNumber() {
        return roomNumber;
    }

    public void setRoomNumber(RoomNumber roomNumber) {
        this.roomNumber = roomNumber;
    }

    public OrderDetails(Integer order_details_id, Integer order_id, Integer room_id, Date startdate, Date enddate, Integer price_sum, Integer room_number_id, Order order, Room room, RoomNumber roomNumber) {
        this.order_details_id = order_details_id;
        this.order_id = order_id;
        this.room_id = room_id;
        this.startdate = startdate;
        this.enddate = enddate;
        this.price_sum = price_sum;
        this.room_number_id = room_number_id;
        this.order = order;
        this.room = room;
        this.roomNumber = roomNumber;
    }
}
